home *** CD-ROM | disk | FTP | other *** search
/ Windows Game Programming for Dummies (2nd Edition) / WinGamProgFD.iso / pc / DirectX SDK / DXSDK / samples / Multimedia / DirectShow_WinXP / VMR / VMRPlayer / vcdplyer.h < prev    next >
Encoding:
C/C++ Source or Header  |  2001-10-08  |  3.2 KB  |  96 lines

  1. //------------------------------------------------------------------------------
  2. // File: vcdplyer.h
  3. //
  4. // Desc: DirectShow sample code
  5. //       - Class header file for VMRPlayer sample
  6. //
  7. // Copyright (c) 1994 - 2001, Microsoft Corporation.  All rights reserved.
  8. //------------------------------------------------------------------------------
  9.  
  10. /* -------------------------------------------------------------------------
  11. ** CMpegMovie - an Mpeg movie playback class.
  12. ** -------------------------------------------------------------------------
  13. */
  14. enum EMpegMovieMode { MOVIE_NOTOPENED = 0x00,
  15.                       MOVIE_OPENED = 0x01,
  16.                       MOVIE_PLAYING = 0x02,
  17.                       MOVIE_STOPPED = 0x03,
  18.                       MOVIE_PAUSED = 0x04 };
  19.  
  20. BOOL VerifyVMR(void);
  21.  
  22. struct IMpegAudioDecoder;
  23. struct IMpegVideoDecoder;
  24. struct IQualProp;
  25.  
  26. class CMpegMovie
  27. {
  28. private:
  29.     // Our state variable - records whether we are opened, playing etc.
  30.     EMpegMovieMode   m_Mode;
  31.     HANDLE           m_MediaEvent;
  32.     HWND             m_hwndApp;
  33.     GUID             m_TimeFormat;
  34.  
  35.     IFilterGraph            *m_Fg;
  36.     IGraphBuilder           *m_Gb;
  37.     IMediaControl           *m_Mc;
  38.     IMediaSeeking           *m_Ms;
  39.     IMediaEvent             *m_Me;
  40.     IVMRWindowlessControl   *m_Wc;
  41.  
  42.     HRESULT AddVideoMixingRendererToFG();
  43.     HRESULT AddBallToFG();
  44.     void GetPerformanceInterfaces();
  45.     HRESULT FindInterfaceFromFilterGraph(
  46.         REFIID iid, // interface to look for
  47.         LPVOID *lp  // place to return interface pointer in
  48.         );
  49.  
  50. public:
  51.      CMpegMovie(HWND hwndApplication);
  52.     ~CMpegMovie();
  53.  
  54.     HRESULT         OpenMovie(TCHAR *lpFileName);
  55.     DWORD           CloseMovie();
  56.     BOOL            PlayMovie();
  57.     BOOL            PauseMovie();
  58.     BOOL            StopMovie();
  59.     OAFilterState   GetStateMovie();
  60.     HANDLE          GetMovieEventHandle();
  61.     long            GetMovieEventCode();
  62.     BOOL            PutMoviePosition(LONG x, LONG y, LONG cx, LONG cy);
  63.     BOOL            GetMoviePosition(LONG *x, LONG *y, LONG *cx, LONG *cy);
  64.     BOOL            GetNativeMovieSize(LONG *cx, LONG *cy);
  65.     BOOL            CanMovieFrameStep();
  66.     BOOL            FrameStepMovie();
  67.     REFTIME         GetDuration();
  68.     REFTIME         GetCurrentPosition();
  69.     BOOL            SeekToPosition(REFTIME rt,BOOL bFlushData);
  70.     EMpegMovieMode  StatusMovie();
  71.     BOOL            IsTimeFormatSupported(GUID Format);
  72.     BOOL            IsTimeSupported();
  73.     BOOL            SetTimeFormat(GUID Format);
  74.     GUID            GetTimeFormat();
  75.     void            SetFocus();
  76.     BOOL            ConfigDialog(HWND hwnd);
  77.     BOOL            RepaintVideo(HWND hwnd, HDC hdc);
  78.     BOOL            SetAppImage(VMRALPHABITMAP* lpBmpInfo);
  79.     BOOL            UpdateAppImage(VMRALPHABITMAP* lpBmpInfo);
  80.     void            SetBorderClr(COLORREF clr);
  81.  
  82.     void            DisplayModeChanged() {
  83.         m_Wc->DisplayModeChanged();
  84.     }
  85.  
  86.     HRESULT         GetCurrentImage(LPBYTE* lplpDib)
  87.     {
  88.         return m_Wc->GetCurrentImage(lplpDib);
  89.     }
  90.  
  91.     HRESULT         RenderSecondFile(TCHAR *lpFileName);
  92.  
  93.     IVMRMixerControl *m_pMixControl;
  94. };
  95.  
  96.